﻿@using MusicX.Web.Shared.Songs
<div class="card d-inline-block align-top" style="width: 13rem;">
    <a href="/songs/@this.Song.Id/@this.Song.SongName"><img class="card-img-top" src="@this.Song.ImageUrl" alt="@this.Song.SongName"></a>
    <div class="card-body">
        <h5 class="card-title">@this.Song.SongName</h5>
        <p class="card-text"></p>
        @if (!string.IsNullOrWhiteSpace(this.Song.PlayableUrl))
        {
            <button class="btn btn-success" @onclick="() => this.MediaPlayer.AddAndPlay(this.Song)"><i class="fas fa-play"></i></button>
            <button class="btn btn-secondary" @onclick="() => this.MediaPlayer.Add(this.Song)"><i class="fas fa-plus"></i></button>
        }
    </div>
</div>

@code {
    [Parameter]
    public SongListItem Song { get; set; }
}
